#!/bin/bash -e

function info() {
echo Usage: `basename $0` '[-l in.bed] snp.vcf indel.vcf'
exit 65
}

while getopts ":p:l:mgh" opts
do
case $opts in
	m) somatic=T;;
	g) single_cell=T;;
	l) interval=$OPTARG;;
	p) out_prefix=$OPTARG;;
	\?) info;;
esac
done
shift $(($OPTIND - 1))

test $# -lt 1 && info


. /mnt/ilustre/app/medical/tools/.var

# common anno first

anno_common.sh -p$out_prefix.indel -l $interval $2 &
anno_common.sh -p$out_prefix.snp -l $interval $1

wait 


# spesific anno second

# common filter

filter_gatk.sh -i $out_prefix.indel.anno.common.vcf &
filter_gatk.sh $out_prefix.snp.anno.common.vcf



wait

# spesific filter

nprot_filter_0627.sh $out_prefix.snp.filtered.vcf $out_prefix.indel.filtered.vcf

impact_anno.sh -p$out_prefix.low $out_prefix.nprot.low.vcf &
impact_anno.sh -p$out_prefix.high $out_prefix.nprot.high.vcf

wait

. $cmd_done

